define(function() {
    return ['$scope','$location', '$interval','$timeout','bizProxy','$log','$cacheFactory','$anchorScroll', function($scope,$location,$interval,$timeout,bizProxy,$log,$cacheFactory,$anchorScroll) {
    	$scope.$emit('flag-tag','5'); 	//显示顶部部文字

    	$scope.targetAmount = '';
    	var suitFeeData = {};
    	var suitTypeList = _YHC_TOOL.suitTypeList;

    	var tempCaseList = _YHC_TOOL.suitFeeJson;
        for(var i=0;i< tempCaseList.length;i++){
            suitFeeData[tempCaseList[i].type] = tempCaseList[i];
        }
        $scope.conditionData = {
            caseType : "财产案件"
        };

        //监听标的额
        $scope.$watch('targetAmount', function(newValue, oldValue, scope) {
            if($scope.targetAmount != "" && $scope.targetAmount != null){
                $scope.showClear = true;
                $scope.lawyerFeeShow = true;
                $scope.hanziNum = _YHC_TOOL.numToHanzi($scope.targetAmount);
                var typeData = suitFeeData[$scope.conditionData.caseType];
                $scope.adjustmentFee = typeData.adjustmentFee($scope.targetAmount);
                $scope.securityFee = typeData.securityFee($scope.targetAmount);
                $scope.executionFee = typeData.executionFee($scope.targetAmount);
            }else{
                $scope.showClear = false;
                $scope.lawyerFeeShow = false;
                var typeData = suitFeeData[$scope.conditionData.caseType];
                $scope.adjustmentFee = typeData.adjustmentFee($scope.targetAmount);
                $scope.securityFee = typeData.securityFee($scope.targetAmount);
                $scope.executionFee = typeData.executionFee($scope.targetAmount);
            }
        });


        //点击清空标的
        $scope.clearNum = function(){
            $scope.targetAmount = "";
            $scope.lawyerFeeShow = false;
            var typeData = suitFeeData[$scope.conditionData.caseType];
            $scope.adjustmentFee = typeData.adjustmentFee($scope.targetAmount);
            $scope.securityFee = typeData.securityFee($scope.targetAmount);
            $scope.executionFee = typeData.executionFee($scope.targetAmount);
            $scope.showClear = false;
        }

		//点击显示案件类型
		$scope.showCaseTypeList = function(){
			$scope.$emit('flag-tag','6'); 
			$scope.isCaseShow = true;
            $scope.caseTypeList = suitTypeList;
			$timeout(function() {
				$scope.isCaseListShow = true;
			}, 200);
		}

		// 点击显示 诉讼费用交纳办法
		$scope.showSuitFeePlan = function() {
            $scope.$emit('flag-tag','7');
            $scope.suitFeePlan = true;
            $timeout(function(){
                $scope.isSuitFeePlan = true;
                $scope.contentDet = _YHC_TOOL.suitFeePlan[0].content;
            }, 200)
        }

        //监听取消 显示 诉讼费用交纳办法
        $scope.$on('dowmsuitFeePlan', function(){
            $scope.$emit('flag-tag','5'); 	//显示顶部部文字
            $scope.isSuitFeePlan = false;
            $timeout(function() {
                $scope.suitFeePlan = false;
            }, 200);
        });

        //监听取消 案件类型
        $scope.$on('downCaseType', function(){
            $scope.$emit('flag-tag','5');   //显示顶部部文字
            $scope.isCaseListShow = false;
            $timeout(function() {
                 $scope.isCaseShow = false;
            }, 200);
        });

        //取消显示案件类型
        $scope.cancleTypeListlist = function(type){
            $scope.isCaseListShow = false;
            $timeout(function() {
                 $scope.isCaseShow = false;
            }, 200);
            $scope.conditionData = {
                caseType : type
            };
            var typeData = suitFeeData[$scope.conditionData.caseType];
            $scope.adjustmentFee = typeData.adjustmentFee($scope.targetAmount);
            $scope.securityFee = typeData.securityFee($scope.targetAmount);
            $scope.executionFee = typeData.executionFee($scope.targetAmount);
        }

        $scope.$apply();
    }];
});